﻿
function showDialog(durl,dtitle, dwidth, dheight) {

    $("#pdiv").dialog({

//        buttons: {
//            " 确 认 ": function () {
//                $("#" + "f_" + $("#currentTabID")[0].value)[0].contentWindow.refresh();
//                $(this).dialog('close');
//                
//            },
//             " 关 闭 ": function () {
//                $(this).dialog('close');
//            }
//        },
        height: dheight, width: dwidth, modal: true, title: dtitle,
        open: function () {
            $(this).html('<iframe src="' + durl + '" frameborder="0" height="100%" width="100%" id="dialogframe" scrolling="auto"></iframe>');
        }
    });
        }
        function showWin(durl, dwidth, dheight) {
            var dtitle = '人员信息编辑';
            $("#pdiv").dialog({
                height: dheight, width: dwidth, modal: true, title: dtitle,
                open: function () {
                    $(this).html('<iframe src="' + durl + '" frameborder="0" height="100%" width="100%" id="dialogframe" scrolling="auto"></iframe>');
                    return false;
                }
            });
            return false;
        }
        function showUnWindowDialog(durl, dwidth, dheight) {
            // window.open(durl, '', 'dialogWidth:' + dwidth + 'px;dialogHeight:' + dheight + 'px;center:yes;status:no;scroll:yes;help:no;');
            var iTop = (window.screen.availHeight - 30 - dheight) / 2; //获得窗口的垂直位置;
            var iLeft = (window.screen.availWidth - 10 - dwidth) / 2; //获得窗口的水平位置;
            window.open(durl, 'newwindow', "height=" + dheight + ", width=" + dwidth + ",top=" + iTop + ",left="+iLeft+", toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no");

        }

//        function showWin(durl, dwidth, dheight) {
//            var wid = dwidth;
//            var dhei = dheight;
////            alert(wid);
////            alert(dhei)
//            var a = window.showModalDialog(durl, "", "dialogWidth:" + wid + "px;dialogHeight:" + dhei + "px;center:yes;status:no;scroll:yes;help:no;");
//       
//            if (a == 'undefined') {
//                return false;
//            }
//            //alert(a);
//            return a;
//        }
        function refresh() {
            //alert(11);
            $("#pdiv").dialog('close');
           window.location = window.location;
        }
        function DeleteCount(id) {
            var gvid = id;
            var count = 0;
            var gridviewId = "#" + gvid;
            var bb = $(gridviewId + " tr td input:checked").each(function () {
                count = count + 1;
            });
            if (count > 0) {
                return confirm('您确认删除吗？', '删除');
            } else {
                alert("请选择一条记录");
                return false;
            }
        }


        function DisabledCount(id) {
            var gvid = id;
            var count = 0;
            var gridviewId = "#" + gvid;
            var bb = $(gridviewId + " tr td input:checked").each(function () {
                count = count + 1;
            });
            if (count > 0) {
                return confirm('您确认禁用吗？', '禁用');
            } else {
                alert("请选择一条记录");
                return false;
            }
        } 
        function abledCount(id) {
            var gvid = id;
            var count = 0;
            var gridviewId = "#" + gvid;
            var bb = $(gridviewId + " tr td input:checked").each(function () {
                count = count + 1;
            });
            if (count > 0) {
                return confirm('您确认启用吗？', '启用');
            } else {
                alert("请选择一条记录");
                return false;
            }
        }




  
   